<script setup>
import { toRefs } from 'vue'

import Tips from './tips.vue'

const props = defineProps({
  keepOut: Boolean
})
const emit = defineEmits(['login'])

const { keepOut } = toRefs(props)

const login = () => {
  emit('login', true)
}
</script>
<template>
  <div class="main">
    <div v-if="keepOut" class="analyse-empty flex flex-start direction">
      <tips text="请点右上角登录后再使用。">
        <a-button type="primary" size="small" @click.stop="login"> 请登录 </a-button>
      </tips>
      <slot name="empty"></slot>
    </div>
    <div v-else class="analyse-content">
      <slot></slot>
    </div>
  </div>
</template>
